// index.js
var numUser;
var numComputer;
Page({

  data:{
    //list:[]
  },


 inputDate:function(e){
    numUser=parseInt(e.detail.value);
  },
  caicaicai:function(e){
    let list=this.data.list;
    if(list==null) list=[]
    list.push(numUser)
    if(list.length>8) list.shift()
    var mess=null;
    if(numUser==numComputer){
   
      mess='恭喜你，猜对啦';
    }else if(numUser<numComputer){
      mess='Sorry,猜小了';
    }else{
      mess='Sorry,猜大了';
    }
    this.setData({result:mess,in:numUser,inkey:'',list});
  },
  onLoad(options){
  numComputer=Math.floor(Math.random()*100);
  console.log('计算机心里想的：',numComputer);
  },

      
    
  
  
})